//
//  MyTeamSonVC.m
//  digitalCurrency
//
//  Created by 小震GG on 2019/11/20.
//  Copyright © 2019 XinHuoKeJi. All rights reserved.
//

#import "MyTeamSonVC.h"
#import "MyTeamSonCell.h"
@interface MyTeamSonVC ()

@property (nonatomic, strong) NSMutableArray *dataArr;

@end

@implementation MyTeamSonVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = tBgQianColor;
    self.viewTitle.text = LocalizationKey(@"团队业绩");
      
    self.dataArr = [[NSMutableArray alloc]init];
    
    [self setTopView];
}

- (void)setTopView{
    UIView *topView = [[UIView alloc]init];
    [self.view addSubview:topView];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(16);
        make.right.equalTo(-16);
        make.top.equalTo(12);
        make.height.equalTo(49);
    }];
    topView.backgroundColor = [UIColor colorWithHexStr:@"#4200FF" alpha:0.05];
    topView.layer.cornerRadius = 5.0;
    
    UILabel *LB1 = [[UILabel alloc]init];
    [topView addSubview:LB1];
    [LB1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(15);
        make.centerY.equalTo(0);
    }];
    LB1.textColor = tSixColor;
    LB1.font = kFontPF_Medium(14);
    LB1.text = LocalizationKey(@"等级");
    
    UILabel *LB2 = [[UILabel alloc]init];
    [topView addSubview:LB2];
    [LB2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(0);
    }];
    LB2.textColor = tSixColor;
    LB2.font = kFontPF_Medium(14);
    LB2.text = LocalizationKey(@"用户名");
    
    UILabel *LB3 = [[UILabel alloc]init];
    [topView addSubview:LB3];
    [LB3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(-15);
        make.centerY.equalTo(0);
    }];
    LB3.textColor = tSixColor;
    LB3.font = kFontPF_Medium(14);
    LB3.text = LocalizationKey(@"业绩(CT)");
    
    
    [self.view addSubview:self.tableView];
    self.tableView.backgroundColor = [UIColor clearColor];
    self.tableView.showsVerticalScrollIndicator = NO;
    self.tableView.showsHorizontalScrollIndicator = NO;
    self.tableView.frame = CGRectMake(0, 73, kWindowW, kWindowH-73-SafeAreaTopHeight);
    self.tableView.rowHeight = 61;
    self.tableView.tableFooterView = [UIView new];
    if (@available(iOS 11.0, *)){
        self.tableView.estimatedRowHeight = 0;
        self.tableView.estimatedSectionHeaderHeight = 0;
        self.tableView.estimatedSectionFooterHeight = 0;//防止刷新指定行时，偏移量改变
    }
    
    [self.tableView reloadData];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.dataArr.count+10;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    MyTeamSonCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"id"];
    if (cell == nil) {
        cell = [[MyTeamSonCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"id"];
    }
        [cell upDataModel:[[NSDictionary alloc]init] indexInt:indexPath.row];
    
    return cell;
   
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
